<!--
 * @Description: 资料下载详情页 -- down_data
 * @Author: your name
 * @Date: 2023-12-14
 * @LastEditTime: 2023-12-14
 * @LastEditors: Please set LastEditors
-->

<template>
  <div>
    <div class="down_data">
      <div class="handpick heart_w">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>资料下载</el-breadcrumb-item>
        </el-breadcrumb>

        <!-- 内容 -->
        <div class="container_content">
          <div class="container_content_imagelist">
            <el-carousel
              trigger="click"
              height="336px"
              indicator-position="outside"
            >
              <el-carousel-item v-for="item in 2" :key="item">
                <el-image
                  src="http://cremb-zsff.oss-cn-beijing.aliyuncs.com/da482202102051439146544.jpg"
                >
                </el-image>
              </el-carousel-item>
            </el-carousel>
          </div>

          <div class="container_content_message">
            <h3>托福考前冲刺班名师讲解十天完成自我突破</h3>
            <div class="content_message_validity">
              <div class="content_message_priceBox">
                <div class="message_priceBox_item">
                  <div>
                    <span>价格：</span>
                  </div>
                  <div>
                    <span class="free">免费</span>
                  </div>
                </div>
                <div>
                  <span>644人已学</span>
                </div>
              </div>
            </div>

            <div class="handle">
              <div @click="CollectionAdd">
                <i class="iconfont icon-shoucang" v-if="coll_val"></i>
                <i
                  class="iconfont icon-shoucang2"
                  style="color: #ff8140"
                  v-else
                >
                </i>
                收藏
              </div>
              <router-link to="/download_datum">
                <el-button type="primary" round>立即下载</el-button>
              </router-link>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container heart_w">
      <div class="container_detils">
        <div class="detils_con">
          <div class="container_content_detils">
            <!-- 1. 详情 -->
            <div class="detils_content" v-if="baseId_img">
              <div class="title">素材详情</div>
              <p>
                <img
                  src="https://video.rycfa.com/image/default/50E5B7E9F329493BA2C6B20B9FEE1A59-6-2.png"
                />
              </p>
            </div>
          </div>
        </div>

        <!-- 推荐课程 -->
        <div class="detils_propaganda">
          <div class="lecturer">课程推荐</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'down_data',
  data() {
    return {
      rankId: 0,
      baseId_img: 1,
      img_active: 113,
      coll_val: true
    }
  },
  created() {},
  methods: {
    async CollectionAdd() {
      this.coll_val = !this.coll_val
      if (this.coll_val == false) {
        await addComboCollection({ id: 1 })
        layer.msg('收藏成功')
      } else {
        await addComboCollection({ id: 1 })
        layer.msg('取消收藏')
      }
    },
    tabsTitles(index, item) {
      this.rankId = index
      this.baseId_img = index
    },
    handpick_ck() {
      // 推荐课程
    },
    //切换分页大小
    handleSizeChange(size) {},
    //切换分页
    handleCurrentChange(current) {}
  }
}
</script>

<style scoped lang="scss">
.el-breadcrumb {
  padding-top: 30px;
  padding-bottom: 20px;
}

.handpick {
  padding-bottom: 70px;
}

.down_data {
  background-color: #ffffff;
}
.container_content {
  display: flex;
  background-color: #ffffff;
  ::v-deep .el-carousel__arrow {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

.container_content_imagelist {
  width: 600px;
  margin-right: 30px;

  .el-image {
    width: 100%;
    height: 336px;
    border-radius: 8px;
  }
  ::v-deep .is-active button {
    height: 4px;
    border-radius: 3px;
  }
}

.container_content_message {
  flex: 1;
  h3 {
    color: #282828;
    font-size: 16px;
    line-height: 18px;
    font-weight: bold;
    padding: 20px 10px 30px 0;
  }
}

.content_message_validity {
  border-radius: 4px;
  margin-bottom: 31px;
  overflow: hidden;

  .content_message_priceBox {
    height: 60px;
    background-color: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 15px;
  }

  .message_priceBox_item {
    display: flex;
    align-items: center;

    div:first-child {
      color: #999999;
      font-size: 14px;
      margin-right: 10px;
    }

    div:last-child {
      .free {
        color: #ff6b00;
        font-size: 24px;
      }
    }
  }

  .message_priceBox_item + div {
    span {
      font-size: 14px;
      color: #999999;
    }
  }
}

.handle {
  margin-top: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  div:first-child {
    font-size: 16px;
    color: #999999;
    cursor: pointer;
    display: flex;
    user-select: none;

    .iconfont {
      margin-right: 5px;
      font-size: 24px;
    }
  }

  .el-button {
    width: 130px;
    height: 45px;
    font-size: 16px !important;
  }

  .el-button.is-round {
    border-radius: 50px;
  }
}

/* 轮播指示器 */
::v-deep .el-carousel__indicators {
  position: absolute;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 2;
}

::v-deep .el-carousel__indicators--horizontal {
  left: auto;
  right: 20px;
  bottom: 20px;
}

.container_detils {
  display: flex;
  margin-top: 30px;
  margin-bottom: 30px;
}

.detils_con {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.container_content_detils {
  flex: 1;
  min-height: 0;
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
}

.detils_propaganda {
  width: 320px;
  margin-left: 14px;
}

.lecturer {
  background-color: #ffffff;
}

/* 详情 */
.detils_content {
  img {
    width: 100%;
  }

  .title {
    position: relative;
    padding-bottom: 13px;
    text-align: center;
    font-weight: bold;
    font-size: 22px;
    line-height: 28px;
    color: #282828;
    margin-bottom: 30px;
  }

  .title::after {
    content: ' ';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 50px;
    height: 3px;
    background-color: #2c8eff;
    transform: translateX(-50%);
  }
}
</style>
